import React from 'react';
import classNames from 'classnames';

export const Tabs = ({ tabs, active, changeSortType }) => {
  return (
    <div className="tabs-order">
      {/* 类on选中效果 */}
      {tabs.map((item) => {
        return (
          <div
            // className={item.type === this.state.active ? 'on' : ''}
            className={classNames({
              on: item.type === active,
            })}
            key={item.id}
            onClick={() => {
              return changeSortType(item.type);
            }}
          >
            按{item.name}排序
          </div>
        );
      })}
    </div>
  );
};
